package com.retoc.graduationtravel.controller;

import com.retoc.graduationtravel.common.ApiRestResponse;
import com.retoc.graduationtravel.domain.Choiceness;
import com.retoc.graduationtravel.service.ChoicenessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/choiceness")
@RestController
public class ChoicenessController {

    @Autowired
    ChoicenessService choicenessService;

    @GetMapping("/list")
    public ApiRestResponse<List<Choiceness>> list() {
        List<Choiceness> list = choicenessService.list();
        return ApiRestResponse.success(list);
    }
}
